package com.magic.smartcity.view.more.adapters

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.lifecycle.Lifecycle
import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayout
import com.magic.smartcity.view.more.bus.BusOrderNotPaidFragment
import com.magic.smartcity.view.more.bus.BusOrderPaidFragment

/**
 * @description:
 * @create: Create by Magic on 2022/2/24.
 */
class BusOrderTabLayoutAdapter(
    private val fragmentManager: FragmentManager,
    val lifecycle: Lifecycle
) : FragmentStateAdapter(fragmentManager, lifecycle) {
    private val TAG: String = "BusOrderTablayoutAdapter"
    override fun getItemCount() = 2

    override fun createFragment(position: Int): Fragment {
        when (position) {
            0 -> return BusOrderNotPaidFragment()
            1 -> return BusOrderPaidFragment()
        }
        return BusOrderNotPaidFragment()
    }
}